Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add download alias for hf_hub_download to HfApi #1580

Merged
merged 2 commits into from
Aug 8, 2023

Conversation

Wauplin
Copy link
Contributor

@Wauplin Wauplin commented Aug 7, 2023

FIX #1573 and #1082.

  • Add endpoint to both hf_hub_download and snapshot_download. Let's be honest, this is used only in unit tests to change to staging endpoint. At least it is aligned with other methods from huggingface_hub (was not the case before)
  • Add hf_hub_download and snapshot_download as aliases in HfApi class. Idea has been discussed on slack (internal link). The main goal is to reuse endpoint, user-agent, token,... parameters from the HfApi instance instead of passing them into each individual call (same as upload_file and upload_folder currently).

cc @severo @mariosasko for #1082
cc @Narsil @hysts for #1573

(note: failing tests are unrelated)

@Wauplin Wauplin requested review from Narsil and LysandreJik August 7, 2023 10:00
@Wauplin Wauplin changed the title 1573 add download aliases to hfapi Add download alias for hf_hub_download to HfApi Aug 7, 2023
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Aug 7, 2023

The documentation is not available anymore as the PR was closed or merged.

Copy link
Member

@LysandreJik LysandreJik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks @Wauplin

Copy link
Contributor

@Narsil Narsil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Wauplin
Copy link
Contributor Author

Wauplin commented Aug 8, 2023

Thanks for the reviews! I'm merging it :)

@Wauplin Wauplin merged commit f4532c9 into main Aug 8, 2023
@Wauplin Wauplin deleted the 1573-add-download-aliases-to-hfapi branch August 8, 2023 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add hf_hub_download / snapshot_download as aliases in HfApi
4 participants